package org.jeecg.modules.oa.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.oa.entity.ApprovalNode;
import org.jeecg.modules.oa.entity.ApprovalProcess;
import org.jeecg.modules.oa.entity.ButtonCondition;

import java.util.List;

/**
 * @Description: 审批节点
 * @Author: jeecg-boot
 * @Date:   2019-12-04
 * @Version: V1.0
 */
public interface ApprovalNodeMapper extends BaseMapper<ApprovalNode> {


  List<ApprovalNode> selectAll(@Param("mainId") String mainId);
  @Select("select count(0) from pd_node where main_id =#{mainId} AND del_flag='0'")
  Integer selectNodeCount(@Param("mainId") String mainId);
  @Select("select id as value,CONCAT('第',sort_no,'节点')as text from pd_node where main_id=#{mainId} and del_flag='0'")
  List<ApprovalNode> selectNode(@Param("mainId") String mainId);

    Integer updateCondition(@Param("buttonId") String buttonId,@Param("conditionFlg")String conditionFlg);

    void saveCondition(ButtonCondition bc);
}
